/**
 * unavailabilities.h is part of %PROJECTNAME%.
 *
 * %PROJECTNAME% is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * %PROJECTNAME% is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with %PROJECTNAME%.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef UNAVAILABILITIES_H
#define UNAVAILABILITIES_H

#include "../resourceconstraint.h"
#include "../../../definitions.h"
#include <vector>

// typedefs.
typedef std::pair< tTime, tTime >               tUnavailabilityPeriod;  // start-end of the unavailability period.
typedef std::vector< tUnavailabilityPeriod >    tUnavailabilityPeriods; // ordered vector of unavailabilities periods.

class Unavailabilities : public ResourceConstraint
{
public:

    Unavailabilities();

    virtual ~Unavailabilities();

    virtual void Accept( Visitor * a_visitor, bool a_depthFirst = true );

    virtual std::string Print() const;

    void Add( const tUnavailabilityPeriod & a_unavailabilityPeriod );

    const tUnavailabilityPeriods & UnavailabilityPeriods() const;
    tUnavailabilityPeriods & UnavailabilityPeriods();

public:

    // Fields.
    // -------

    tUnavailabilityPeriods m_unavailabilityPeriods;

    // Methods.
    // --------

    // Protect default copy constructor.
    Unavailabilities( const Unavailabilities & a_other );

    // Protect default operator =.
    Unavailabilities & operator = ( const Unavailabilities & a_other );
};

#endif // UNAVAILABILITIES_H
